package org.bioversityinternational.mgbms.model.domain;

// Generated 13 oct. 2011 12:11:05 by Hibernate Tools 3.4.0.CR1

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Login generated by hbm2java
 */
@Entity
@Table(name = "Login", schema = "dbo", catalog = "imgbms", uniqueConstraints = @UniqueConstraint(columnNames = "contactId"))
public class Login implements java.io.Serializable {

	private Integer id;
	private NewCentre newCentre;
	private Contact contact;
	private String password;

	public Login() {
	}

	public Login(Contact contact, String password) {
		this.contact = contact;
		this.password = password;
	}

	public Login(NewCentre newCentre, Contact contact, String password) {
		this.newCentre = newCentre;
		this.contact = contact;
		this.password = password;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "newcentreId")
	public NewCentre getNewCentre() {
		return this.newCentre;
	}

	public void setNewCentre(NewCentre newCentre) {
		this.newCentre = newCentre;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "contactId", unique = true, nullable = false)
	public Contact getContact() {
		return this.contact;
	}

	public void setContact(Contact contact) {
		this.contact = contact;
	}

	@Column(name = "password", nullable = false, length = 16)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

}
